/**
 * 
 */
package com.fresh.api;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fresh.common.annotation.IgnoreAuth;
import com.fresh.entity.AntifraudUser;
import com.fresh.utils.DateUtil;
import com.fresh.utils.HttpUtils;
import com.fresh.utils.PropertiesUtils;

/**
 * @author 作者姓名 E-mail: email地址
 * @version 创建时间：2017年11月17日 上午9:23:59
 * 类说明
 */
/**
 * @author Administrator
 *
 */
@RequestMapping({ "/zhima" })
@Controller
public class ZhiMaController {
	
	private static final Logger log = LoggerFactory.getLogger(ZhiMaController.class);


	@ResponseBody
	@IgnoreAuth
	@RequestMapping({ "getScore" })
	public String toNut(HttpServletRequest request, AntifraudUser user)
			throws Exception {
		log.info("#getScore() 进入芝麻信用评分查询页！");
		
		String zhimaUrl = PropertiesUtils.getProperty("zhimaUrl");
		
		String resUrl=zhimaUrl+"?method=zhima.credit.score.get&charset=utf-8&app_id=2088821752011535";
		String resqueryJson = HttpUtils.doPostx(resUrl, null, null, 3, 10, "utf-8");
		System.out.println("==="+resqueryJson);
		System.out.println("ok！");
		
		return resqueryJson;
	}
	
	public static void main(String[] args) {
		
		System.out.println(DateUtil.getTimeStampStr(new Date()));
	}
}
